HYPERFLEET-630 - fix: consolidate duplicate resource operation logs#84
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (3)
WalkthroughThe pull request updates manifest apply behavior to treat a resource creation failure with an "already exists" error as a concurrent-create race: the apply result is changed to Sequence Diagram(s)sequenceDiagram
participant Caller
participant k8sclient
participant K8sAPI
participant Logger
Caller->>k8sclient: ApplyManifest(manifest, existing=nil)
k8sclient->>K8sAPI: CreateResource(manifest)
alt API returns Created
K8sAPI-->>k8sclient: Created (no error)
k8sclient-->>Caller: ApplyResult(OperationCreate)
else API returns AlreadyExists error
K8sAPI-->>k8sclient: Error: AlreadyExists
k8sclient->>Logger: Debug("concurrent create detected")
k8sclient-->>Caller: ApplyResult(OperationSkip, reason="already exists (concurrent create)")
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
1dbb531 to
ba4011f
Compare
Remove redundant pre/post operation logs from k8s_client and maestro_client CRUD methods. The executor layer provides a single authoritative INFO log per resource operation. The apply-layer decision log (operation + reason) is retained at DEBUG level. Handle "already exists" errors from concurrent creates gracefully by treating them as a successful skip instead of an ERROR.
ba4011f to
b24c590
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rafabene The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
196cd24
into
openshift-hyperfleet:main
Summary
k8s_clientandmaestro_clientCRUD methods (25 log lines removed)Test plan
make test-allpasses (lint + unit + integration tests)Relates to: HYPERFLEET-630
Summary by CodeRabbit
Bug Fixes
Chores
Tests